import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';

import {UsersService} from './user/users.service';
import {ThreadsService} from './thread/threads.service';
import {MessagesService} from './message/messages.service';

import {AppComponent} from './app.component';
import {ChatMessageComponent} from './chat-message/chat-message.component';
import {ChatThreadComponent} from './chat-thread/chat-thread.component';
import {ChatNavBarComponent} from './chat-nav-bar/chat-nav-bar.component';
import {ChatThreadsComponent} from './chat-threads/chat-threads.component';
import {ChatWindowComponent} from './chat-window/chat-window.component';
import {ChatPageComponent} from './chat-page/chat-page.component';
import {FromNowPipe} from './pipes/from-now.pipe';
import {RouterModule, Routes} from '@angular/router';
import {ChatHttpComponent} from './chat-http/chat-http.component';
import {ChatProductData} from './data/chat-product-data';

const routeConfig: Routes = [
  {
    path: '', component: ChatThreadsComponent
  }, {
    path: 'window/:threadId', component: ChatWindowComponent
  }
];

@NgModule({
  declarations: [
    AppComponent,
    ChatMessageComponent,
    ChatThreadComponent,
    ChatNavBarComponent,
    ChatThreadsComponent,
    ChatWindowComponent,
    ChatPageComponent,
    FromNowPipe,
    ChatHttpComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(routeConfig)
  ],
  providers: [
    MessagesService, ThreadsService, UsersService, ChatHttpComponent
  ],

  bootstrap: [AppComponent]
})
export class AppModule {
}
